<?php

$frontHead = "<?php
$%SQLconnect = mysql_connect(\"$db_host\",\"$db_username\",\"$db_password\");
$%SQLlist = \"SELECT * FROM $tableName\";
	
if (!$%SQLconnect) { echo(\"SQL Connection Error: \" . mysql_error() . \"\\n\");	}\n
else {
	$%SQLexecute = mysql_db_query(\"$db_name\",$%SQLlist,$%SQLconnect);
	if (!$%SQLexecute) { echo(\"SQL Execution Error: \" . mysql_error() . \"\\n$%SQL\\n\");	}
	else {
		while($%rowArray = mysql_fetch_array($%SQLexecute,MYSQL_ASSOC)) {;
			$%bodyString .= \"\n<div class='".$tableName."_record'>\";";
			
			$frontBody = "\n	
			$%bodyString .= \"\n</div>\";					
		}
	}
}
mysql_close($%SQLconnect);
?>
<html>
	<head>
		<title>$tableName Front</title>
	<link rel=\"stylesheet\" type=\"text/css\" href=\"io_cms.css\" />
	</head>
	<body><?php echo $%bodyString;";
		$frontFooter = " ?>
	\n
	</body>
</html>";
		$pageSource = str_replace("%", "", $frontHead) . str_replace("%", "", $fieldVarsString) .  $frontListElements . str_replace("%", "", $frontBody) . str_replace("%", "", $frontFooter);


?>